const dbConfig = require("../config/db.config.js");
const Sequelize = require("sequelize");

const sequelize = new Sequelize(
    dbConfig.DB,
    dbConfig.USER,
    dbConfig.PASSWORD,
    {
        host: dbConfig.HOST,
        dialect: dbConfig.dialect,
        define: {
            timestamps: false
        }
    }
)

const db = {};
db.sequelize = sequelize;
db.Sequelize = Sequelize;

/*
db.stock = require("./stock.model.js")(sequelize, Sequelize);
db.personal_user = require("./personal_user.model.js")(sequelize, Sequelize);
db.legal_user = require("./legal_user.model.js")(sequelize, Sequelize);
db.order = require("./order.model.js")(sequelize, Sequelize);
db.admin = require("./admin.model.js")(sequelize, Sequelize);
db.blocked_stock = require("./blocked_stock.model.js")(sequelize, Sequelize);
db.instruction = require("./instruction.model.js")(sequelize, Sequelize);
*/

db.tech = require("./tech.model.js")(sequelize, Sequelize);
db.depend = require("./depend.model.js")(sequelize, Sequelize);
db.learning_route = require("./learning_route.model")(sequelize, Sequelize);
db.daily_task = require("./daily_task.model")(sequelize,Sequelize);
db.login = require("./login.models")(sequelize, Sequelize);
db.course = require("./course.model")(sequelize, Sequelize);

module.exports = db